]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
messageTray: only set stage input mode when necessary
authorRay Strode <rstrode@redhat.com>
Mon, 17 Oct 2011 03:45:37 +0000 (23:45 -0400)
committerRay Strode <rstrode@redhat.com>
Mon, 17 Oct 2011 17:24:12 +0000 (13:24 -0400)
The message tray focus grabbing code sets the stage input
mode to Shell.StageInputMode.FOCUSED when the overview is
not visible. This ensures the stage window's input
region gets reshaped to include the notification chrome,
and so that input events get delivered appropriately to
the notification that grabbed focus.

The message tray code never tries to restore the stage input
mode later. Instead, the code relies on the stage input
mode (and input region) getting reset to
shell.StageInputMode.NORMAL automatically when focus moves
back from the shell chrome to a window in the user's session.

It's not really correct to set the stage input mode based
on the overview's visibility, though. At the login screen,
even though no overview is visible, the stage input mode is
Shell.StageInputMode.FULLSCREEN which is sufficient
for the notification's needs,  Furthermore,
Shell.StageInputMode.FOCUSED is insufficient for the login
dialog's needs since the login dialog isn't considered
part of the shell's chrome and won't get included in the
stage input region.

This commit changes the message tray code to only set the
stage input mode if the current stage input mode isn't good enough,
rather than assuming the input mode isn't good enough just because
the overview is hidden.

https://bugzilla.gnome.org/show_bug.cgi?id=660919

js/ui/messageTray.js

index a45fae44b7d6b53ce76a1159a7558bd5c18b278a..e2df316d7b7f633192329c2c4a142d811fb19ec8 100644 (file)
@@ -252,7 +252,8 @@ FocusGrabber.prototype = {
         this._prevFocusedWindow = global.display.focus_window;
         this._prevKeyFocusActor = global.stage.get_key_focus();
 
-        if (!Main.overview.visible)
+        if (global.stage_input_mode == Shell.StageInputMode.NONREACTIVE ||
+            global.stage_input_mode == Shell.StageInputMode.NORMAL)
             global.set_stage_input_mode(Shell.StageInputMode.FOCUSED);
 
         // Use captured-event to notice clicks outside the focused actor